/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package bd_registro_civil;

import java.io.Serializable;
import java.util.Date;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author Earving
 */
@Entity
@Table(name = "acta")
@NamedQueries({
    @NamedQuery(name = "Acta.findAll", query = "SELECT a FROM Acta a"),
    @NamedQuery(name = "Acta.findByIdActa", query = "SELECT a FROM Acta a WHERE a.idActa = :idActa"),
    @NamedQuery(name = "Acta.findByCurp", query = "SELECT a FROM Acta a WHERE a.curp = :curp"),
    @NamedQuery(name = "Acta.findByNombre", query = "SELECT a FROM Acta a WHERE a.nombre = :nombre"),
    @NamedQuery(name = "Acta.findByApp", query = "SELECT a FROM Acta a WHERE a.app = :app"),
    @NamedQuery(name = "Acta.findByApm", query = "SELECT a FROM Acta a WHERE a.apm = :apm"),
    @NamedQuery(name = "Acta.findByFechaNac", query = "SELECT a FROM Acta a WHERE a.fechaNac = :fechaNac"),
    @NamedQuery(name = "Acta.findByHoraNac", query = "SELECT a FROM Acta a WHERE a.horaNac = :horaNac"),
    @NamedQuery(name = "Acta.findByLugarNac", query = "SELECT a FROM Acta a WHERE a.lugarNac = :lugarNac"),
    @NamedQuery(name = "Acta.findByFechaReg", query = "SELECT a FROM Acta a WHERE a.fechaReg = :fechaReg"),
    @NamedQuery(name = "Acta.findByHoraReg", query = "SELECT a FROM Acta a WHERE a.horaReg = :horaReg"),
    @NamedQuery(name = "Acta.findByLibro", query = "SELECT a FROM Acta a WHERE a.libro = :libro"),
    @NamedQuery(name = "Acta.findByHoja", query = "SELECT a FROM Acta a WHERE a.hoja = :hoja")})
public class Acta implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id_acta")
    private Integer idActa;
    @Basic(optional = false)
    @Column(name = "curp")
    private String curp;
    @Basic(optional = false)
    @Column(name = "nombre")
    private String nombre;
    @Basic(optional = false)
    @Column(name = "app")
    private String app;
    @Column(name = "apm")
    private String apm;
    @Basic(optional = false)
    @Column(name = "fecha_nac")
    @Temporal(TemporalType.DATE)
    private Date fechaNac;
    @Column(name = "hora_nac")
    @Temporal(TemporalType.TIME)
    private Date horaNac;
    @Column(name = "lugar_nac")
    private String lugarNac;
    @Basic(optional = false)
    @Column(name = "fecha_reg")
    @Temporal(TemporalType.DATE)
    private Date fechaReg;
    @Column(name = "hora_reg")
    @Temporal(TemporalType.TIME)
    private Date horaReg;
    @Basic(optional = false)
    @Column(name = "libro")
    private String libro;
    @Basic(optional = false)
    @Column(name = "hoja")
    private String hoja;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "acta")
    private List<Testigo> testigoList;
    @JoinColumn(name = "id_genero", referencedColumnName = "id_genero")
    @ManyToOne
    private Genero genero;
    @JoinColumn(name = "id_juez", referencedColumnName = "id_juez")
    @ManyToOne
    private Juez juez;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "acta")
    private List<Comparecio> comparecioList;

    public Acta() {
    }

    public Acta(Integer idActa) {
        this.idActa = idActa;
    }

    public Acta(Integer idActa, String curp, String nombre, String app, Date fechaNac, Date fechaReg, String libro, String hoja) {
        this.idActa = idActa;
        this.curp = curp;
        this.nombre = nombre;
        this.app = app;
        this.fechaNac = fechaNac;
        this.fechaReg = fechaReg;
        this.libro = libro;
        this.hoja = hoja;
    }

    public Integer getIdActa() {
        return idActa;
    }

    public void setIdActa(Integer idActa) {
        this.idActa = idActa;
    }

    public String getCurp() {
        return curp;
    }

    public void setCurp(String curp) {
        this.curp = curp;
    }

    public String getNombre() {
        return nombre;
    }

    public void setNombre(String nombre) {
        this.nombre = nombre;
    }

    public String getApp() {
        return app;
    }

    public void setApp(String app) {
        this.app = app;
    }

    public String getApm() {
        return apm;
    }

    public void setApm(String apm) {
        this.apm = apm;
    }

    public Date getFechaNac() {
        return fechaNac;
    }

    public void setFechaNac(Date fechaNac) {
        this.fechaNac = fechaNac;
    }

    public Date getHoraNac() {
        return horaNac;
    }

    public void setHoraNac(Date horaNac) {
        this.horaNac = horaNac;
    }

    public String getLugarNac() {
        return lugarNac;
    }

    public void setLugarNac(String lugarNac) {
        this.lugarNac = lugarNac;
    }

    public Date getFechaReg() {
        return fechaReg;
    }

    public void setFechaReg(Date fechaReg) {
        this.fechaReg = fechaReg;
    }

    public Date getHoraReg() {
        return horaReg;
    }

    public void setHoraReg(Date horaReg) {
        this.horaReg = horaReg;
    }

    public String getLibro() {
        return libro;
    }

    public void setLibro(String libro) {
        this.libro = libro;
    }

    public String getHoja() {
        return hoja;
    }

    public void setHoja(String hoja) {
        this.hoja = hoja;
    }

    public List<Testigo> getTestigoList() {
        return testigoList;
    }

    public void setTestigoList(List<Testigo> testigoList) {
        this.testigoList = testigoList;
    }

    public Genero getGenero() {
        return genero;
    }

    public void setGenero(Genero genero) {
        this.genero = genero;
    }

    public Juez getJuez() {
        return juez;
    }

    public void setJuez(Juez juez) {
        this.juez = juez;
    }

    public List<Comparecio> getComparecioList() {
        return comparecioList;
    }

    public void setComparecioList(List<Comparecio> comparecioList) {
        this.comparecioList = comparecioList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idActa != null ? idActa.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Acta)) {
            return false;
        }
        Acta other = (Acta) object;
        if ((this.idActa == null && other.idActa != null) || (this.idActa != null && !this.idActa.equals(other.idActa))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "bd_registro_civil.Acta[idActa=" + idActa + "]";
    }

}
